<?php
namespace Home\Controller;
use Common\Controller\HomeBaseController;

class IndexController extends HomeBaseController {
    public function index(){
        //  获取 合作伙伴 客户致谢 内容
        $thanks = M('article') -> where(['cate_id' => 12]) -> select();
        $this -> assign('thanks', $thanks);

        //  获取产品分类信息
        $category = M('Category');
        $categoryInfo = $category -> field('id,pid,title') -> where(['type' => 2]) -> select();
        $categoryInfo = make_tree($categoryInfo);
        $this -> assign('categoryInfo', $categoryInfo);

        //  获取藏品信息
        $product  = M('Product');
        $productInfo = $product -> field('id,images,title') -> limit('0,12') -> order('id') -> select();
        $this -> assign('productInfo', $productInfo);


        $this -> display();
    }
}